//
// Created by hsj on 2022/1/7.
//
#include <iostream>
#include "t_inline_func.h"
extern void test_inline_support();
//测试内联函数
//内联函数
//调用时候：内联函数与常规函数一样
//区别C语言的宏定义（调用时候：仅仅是简单的字符串替换） ：
//                                              #define square(x) ((x)*(x))
void test_inline_func(){
    using namespace std;

    double a,b;
    double c  = 13.0;

    a = square(5.0);
    b = square(4.5 + 7.5);
    cout<<"square addr :"<<&square<<endl;
    cout<<a<<endl;
    cout<<b<<endl;

    cout<<" before c value is:"<<c<<endl;
    cout<<" c square value is:"<<square(c++)<<endl;
    cout<<" after c value is:"<<c<<endl;
    cout<<"*******************************"<<endl;
    test_inline_support();
}
